﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Avatar.MembershipService;
using Avatar.Common;
using Avatar.Company;

public partial class Company : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        LoginManager.CompanyAccessCheck();
        if (!IsPostBack)
        {
            var _user = LoginManager.GetCurrentUser();
            if (_user != null)
            {
                if (!Request.Url.ToString().ToLower().Contains("company_information.aspx") && !Request.Url.ToString().ToLower().Contains("company_contact.aspx"))
                {
                    var _information = CompanyInformationManager.GetCompanyInformation(_user.UserName);
                    var _contact = CompanyContactManager.GetContact(_user.UserName);

                    if (_information == null) Helper.ShowMassage("您的企业基本资料尚未填写，接下来请填写您企业的基本资料。", "Company_Information.aspx");
                    if (_contact == null) Helper.ShowMassage("您的企业联系信息尚未填写，接下来请填写您企业的联系信息。", "Company_Contact.aspx");
                }
            }
        }
    }
    protected void btn_LogOut_Click(object sender, EventArgs e)
    {
        LoginManager.Logout();
    }
}
